import unittest
import requests

class loginTest(unittest.TestCase):
    def setUp(self) -> None:
        self.url = "http://ihrm-test.itheima.net/api/sys/login"
        print("start")
    def tearDown(self) -> None:
        print("end")

    def test001(self):
        json = {"mobile":"13800000002","password":"123456"}
        respones = requests.post(self.url,json=json)
        print(respones.json())
        print(respones.json().get('success'))
        print(respones.json().get("message"))
        print(respones.headers.get("Content-Type"))
        print(respones.status_code)
        self.assertEqual(200,respones.status_code)
        self.assertEqual(True,respones.json().get('success'))

    def test002(self):
        json = {"mobile":"13800000002","password":"123456"}
        respones = requests.post(self.url,json=json)
        print(respones.json())
        print(respones.json().get('success'))
        print(respones.json().get("message"))
        print(respones.headers.get("Content-Type"))
        print(respones.status_code)
        self.assertEqual(200,respones.status_code)
        self.assertEqual(True,respones.json().get('success'))

    def test003(self):
        json = {"mobile":"13800000002","password":"123456"}
        respones = requests.post(self.url,json=json)
        print(respones.json())
        print(respones.json().get('success'))
        print(respones.json().get("message"))
        print(respones.headers.get("Content-Type"))
        print(respones.status_code)
        self.assertEqual(200,respones.status_code)
        self.assertEqual(True,respones.json().get('success'))